class Solution {
public:
    int duplicate(vector<int>& numbers) {
        // write code here
        unordered_map<int, int> map;
        for (const auto& num : numbers)
            map[num]++;
        for (int i = 0; i < map.size(); ++i)
        {
            if (map[i] >= 2)
                return i;
        }
        return -1;
    }
};